Ext.define('PJ.view.messagemanagement.View', {
	extend: 'AM.default.DefaultWindowForm',
	alias: ['widget.msgView'],
	requires: ['AM.default.DefaultDateField', 
	           'AM.default.DateTime',
	           'AM.default.jsonp.DefaultSubmitJsonp',
	           'AM.default.DefaultDateField',
	           'PJ.view.messagemanagement.AttachmentList',//附件列表
	           'PJ.view.messagemanagement.ReceiverFrame'],

	modal: true,// 开启不允许点击其他组件
	frame: true,
	notEdit: true,
	width: 520,
	height:340,
	layout: 'form',
	isSame: false,
	autoHeight: true,

	initComponent: function(){
    	var me = this;
    	var bt = '';
    	me.items= [{
    		defaults: {
    			labelAlign: 'right',
    			labelWidth: 70,
    			columnWidth: .995,
    			padding:"5 0 0 0",
    			readOnly:true
    		},
    		border: false,
    		xtype: "container",
    		width: 500,
    		layout: 'column',
    		items: [{
            	xtype: 'textfield',
                fieldLabel: me.text=="接收通知"?"发送人":"接收人",
                name:  me.text=="接收通知"?"userName":"receiveUserNames",
	            allowBlank: false,
	            readOnly:true
            },{
            	xtype: 'textfield',
            	fieldLabel: bt + '通知类型',
                name: me.text=="接收通知"?"newsCode":"newsType",
                allowBlank: false,
	            readOnly:true
            },{
            	xtype: 'textfield',
                fieldLabel: bt+'通知标题',
                name: 'newsTitle',
	            allowBlank: false,
	            readOnly:true
            },{
            	xtype: 'textfield',
                fieldLabel: bt+ "培训班名称",
                name: 'specialName',
	            readOnly:true
            },{
    			xtype: 'textarea',
    			fieldLabel: bt+'通知内容',
    			name: "newsValue",
    			allowBlank: false,
    			height: 100,
    			maxLength: 200
    		},{
        		xtype:"attachmentList",
        		height: 55
        	},{
    			xtype:'hidden',
    			name:'receiveUserIds'
    		},{
    			xtype: 'hidden',
    			name: 'attachmentId'
    		}]
    	}];
    	this.buttons = [{
            text: '关闭',
            scope: this,
            handler: function(button, event){
                var win = button.up('window');
                win.grid.getStore().load();
                win.close();
            }
        }];
		this.callParent(arguments);
	}
});